#[cfg(test)]
mod test {
    use dj::builtin::{builtin, builtin_method, dependency::*};

    #[test]
    fn dj_builtin_test_no_attribute() {
        #[builtin_method]
        fn add(a: i32, b: Value, _op_val: Option<String>, _env: Rc<Env>) -> EvalResult {
            let b: i32 = b.try_into()?;
            Ok((a + b).into())
        }

        let env = dj::Env::root();

        builtin!(env, "add", add);
        let a = 1;
        let b = 2;
        let c = "123";
        let eval_res = env.eval(dj::parse(format!("(add {} {} {:?})", a, b, c)).unwrap());
        assert!(eval_res.is_ok() && eval_res.unwrap().eq((a + b).into()).is_ok());
    }
}
